import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";

const routes = [
  { path: "/", redirect: "/index/home" },
  { path: "/index", redirect: "/index/home" },
  {
    path: "/index/home",
    name: "home",
    component: () => import("@/view/home.vue"),
    meta: {
      title: "首页",
      tabbar: true,
      active: 0, //首页0 全部记录1 记录中心2 个人中心3
    },
  },
  {
    path: "/index/login",
    name: "登录",
    component: () => import("@/view/login.vue"),
    meta: {
      title: "登录",
    },
  },
  {
    path: "/index/register",
    name: "注册",
    component: () => import("@/view/register.vue"),
    meta: {
      title: "注册",
    },
  },
  {
    path: "/index/forgetPassword",
    name: "忘记密码",
    component: () => import("@/view/forgetPassword.vue"),
    meta: {
      title: "忘记密码",
    },
  },
  {
    path: "/index/home/project",
    name: "产品",
    component: () => import("@/view/home/project.vue"),
    meta: {
      title: "产品",
    },
  },
  {
    path: "/index/home/book",
    name: "证书",
    component: () => import("@/view/home/book.vue"),
    meta: {
      title: "证书",
    },
  },
  {
    path: "/index/home/top",
    name: "顶级",
    component: () => import("@/view/home/top.vue"),
    meta: {
      title: "顶级",
    },
  },
  {
    path: "/index/home/shop",
    name: "店铺",
    component: () => import("@/view/home/shop.vue"),
    meta: {
      title: "店铺",
    },
  },
  {
    path: "/index/home/jielong",
    name: "我要预约",
    component: () => import("@/view/home/jielong.vue"),
    meta: {
      title: "我要预约",
    },
  },
  {
    path: "/index/order/order",
    name: "订单",
    component: () => import("@/view/order/order.vue"),
    meta: {
      title: "订单",
      tabbar: true,
      active: 1, //首页0 全部记录1 记录中心2 个人中心3
    },
  },
  {
    path: "/index/distribution/distribution",
    name: "分销中心",
    component: () => import("@/view/distribution/distribution.vue"),
    meta: {
      title: "分销中心",
      tabbar: true,
      active: 2, //首页0 全部记录1 记录中心2 个人中心3
    },
  },
  {
    path: "/index/distribution/withdrawal",
    name: "提现",
    component: () => import("@/view/distribution/withdrawal.vue"),
    meta: {
      title: "提现",
    },
  },
  {
    path: "/index/distribution/withdrawalDetai",
    name: "提现明细",
    component: () => import("@/view/distribution/withdrawalDetai.vue"),
    meta: {
      title: "提现明细",
    },
  },
  {
    path: "/index/distribution/bonusDetail",
    name: "推广奖金",
    component: () => import("@/view/distribution/bonusDetail.vue"),
    meta: {
      title: "推广奖金",
    },
  },
  {
    path: "/index/distribution/tgorder",
    name: "推广订单",
    component: () => import("@/view/distribution/tgorder.vue"),
    meta: {
      title: "推广订单",
    },
  },
  {
    path: "/index/distribution/fans",
    name: "我的粉丝",
    component: () => import("@/view/distribution/fans.vue"),
    meta: {
      title: "我的粉丝",
    },
  },
  {
    path: "/index/distribution/yejiOrder",
    name: "业绩订单",
    component: () => import("@/view/distribution/yejiOrder.vue"),
    meta: {
      title: "业绩订单",
    },
  },
  {
    path: "/index/distribution/capitalDetail",
    name: "资金明细",
    component: () => import("@/view/distribution/capitalDetail.vue"),
    meta: {
      title: "资金明细",
    },
  },
  {
    path: "/index/distribution/commissionDetail",
    name: "佣金明细",
    component: () => import("@/view/distribution/commissionDetail.vue"),
    meta: {
      title: "佣金明细",
    },
  },
  {
    path: "/index/shoping/shoping",
    name: "操作台",
    component: () => import("@/view/shoping/shoping.vue"),
    meta: {
      title: "操作台",
    },
  },
  {
    path: "/index/shoping/orderManagement",
    name: "订单管理",
    component: () => import("@/view/shoping/orderManagement.vue"),
    meta: {
      title: "订单管理",
      search: true,
    },
  },
  {
    path: "/index/shoping/listingReview",
    name: "上架审核",
    component: () => import("@/view/shoping/listingReview.vue"),
    meta: {
      title: "上架审核",
    },
  },
  {
    path: "/index/shoping/withdrawalReview",
    name: "提现审核",
    component: () => import("@/view/shoping/withdrawalReview.vue"),
    meta: {
      title: "提现审核",
    },
  },
  {
    path: "/index/shoping/shopAchievement",
    name: "店业绩",
    component: () => import("@/view/shoping/shopAchievement.vue"),
    meta: {
      title: "店业绩",
    },
  },
  {
    path: "/index/shoping/transfer",
    name: "转移确认",
    component: () => import("@/view/shoping/transfer.vue"),
    meta: {
      title: "转移确认",
    },
  },
  {
    path: "/index/shoping/certificateManagement",
    name: "证书管理",
    component: () => import("@/view/shoping/certificateManagement.vue"),
    meta: {
      title: "证书管理",
      search: true,
    },
  },
  {
    path: "/index/shoping/exchangeManagement",
    name: "上架兑换管理",
    component: () => import("@/view/shoping/exchangeManagement.vue"),
    meta: {
      title: "上架兑换管理",
    },
  },
  {
    path: "/index/shoping/pickupManagement",
    name: "上架提货管理",
    component: () => import("@/view/shoping/pickupManagement.vue"),
    meta: {
      title: "上架提货管理",
    },
  },
  {
    path: "/index/shoping/setNumber",
    name: "设置编号",
    component: () => import("@/view/shoping/setNumber.vue"),
    meta: {
      title: "设置编号",
    },
  },
  {
    path: "/index/personal/personal",
    name: "个人中心",
    component: () => import("@/view/personal/personal.vue"),
    meta: {
      title: "个人中心",
      tabbar: true,
      active: 3, //首页0 全部记录1 记录中心2 个人中心3
    },
  },
  {
    path: "/index/personal/bindingInformation",
    name: "绑定信息",
    component: () => import("@/view/personal/bindingInformation.vue"),
    meta: {
      title: "绑定信息",
    },
  },
  {
    path: "/index/personal/redeemOrder",
    name: "兑换订单",
    component: () => import("@/view/personal/redeemOrder.vue"),
    meta: {
      title: "兑换订单",
    },
  },
  {
    path: "/index/personal/address",
    name: "我的地址",
    component: () => import("@/view/personal/address.vue"),
    meta: {
      title: "我的地址",
    },
  },
  {
    path: "/index/personal/editPsd",
    name: "修改密码",
    component: () => import("@/view/personal/editPsd.vue"),
    meta: {
      title: "修改密码",
    },
  },
];
const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
